<include file="public@header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:url('applynumbers/index')}">申户列表列表</a></li>
			<li><a href="{:url('applynumbers/add')}">添加申户列表</a></li>
		</ul>
        <form class="well form-inline margin-top-20" method="post" action="{:url('applynumbers/index')}" style="width:50%; max-width: 50%; float: left;">
            公司名称:
            <input type="text" class="form-control" name="apply_name" style="width: 200px;" value="{:input('request.apply_name/s','')}" placeholder="请输入公司名称">
            <input type="submit" class="btn btn-primary" value="搜索" />
            <a class="btn btn-danger" href="{:url('applynumbers/index')}">清空</a>
        </form>

        <form class="well form-inline margin-top-20" method="post" action="{:url('applynumbers/exportfile')}" style="width:50%; max-width: 50%; float: left;">
            <input class="btn" id="excel-1" type="hidden" name="upload_filename_url1" >
         	<input  class="btn btn-danger" id="excel-1-name" type="text" name="upload_filename" title="Excel名称">
         	<a href="javascript:uploadOne('Excel上传','#excel-1','file');" class="btn btn-danger">Excel文件上传</a>
         	<button type="submit" class="btn btn-primary js-ajax-submit">导入</button>

         	<a href="<?='http://'.$_SERVER['HTTP_HOST'].'/upload/admin/muban_190725.xls'?>"> 模板下载</a>
        </form>
        <div style="clear: both;"></div>
		<table class="table table-hover table-bordered" style="width:170%; max-width: 170%">
			<thead>
				<tr>
					<th>id</th>
					<th>公司名称</th>
					<th>申户域名</th>
					<th>首次代理</th>
					<th>归属一代</th>
					<th>归属二代</th>
					<th>主体状态</th>
					<th>开户数</th>
					<th>下户数</th>
					<th>申户日期</th>
					<th>下户日期</th>
					<th>申户组</th>
					<th>负责人</th>
					<th>营业照片</th>
					<th>是否拉黑</th>
					<th>备注</th>
					<th>创建时间</th>
					<th>更新时间</th>
					
					<th width="130">{:lang('ACTIONS')}</th>
				</tr>
			</thead>
			<tbody>
				<foreach name="applynumbersList" item="vo">
				<php>
					$apply_image = 'http://'.$_SERVER['HTTP_HOST'].'/upload/'.$vo['apply_image'];

					$apply_main_status = $vo['apply_main_status'];
					$apply_main_status = $apply_main_status_config[$apply_main_status];

					$apply_one_agents = $apply_one_blongs = $apply_two_blongs = '';
					if($vo['apply_one_agent']){
						$apply_one_agent = explode(',', $vo['apply_one_agent']);
						foreach($apply_one_agent as $k => $v){
							$apply_one_agents .=  $apply_agent_config[$v].'/';
						}
						$apply_one_agents = trim($apply_one_agents, '/');
					}

					if($vo['apply_one_blong']){
						$apply_one_blong = explode(',', $vo['apply_one_blong']);
						foreach($apply_one_blong as $k => $v){
							$apply_one_blongs .=  $apply_agent_config[$v].'/';
						}
						$apply_one_blongs = trim($apply_one_blongs, '/');
					}

					if($vo['apply_two_blong']){
						$apply_two_blong = explode(',', $vo['apply_two_blong']);
						foreach($apply_two_blong as $k => $v){
							$apply_two_blongs .=  $apply_agent_config[$v].'/';
						}
						$apply_two_blongs = trim($apply_two_blongs, '/');
					}

				</php>
				<tr>
					<td>{$vo.id}</td>
					<td>{$vo.apply_name}</td>
					<td>{$vo.apply_url}</td>
					<td>{$apply_one_agents}</td>
					<td>{$apply_one_blongs}</td>
					<td>{$apply_two_blongs}</td>
					<td>{$apply_main_status}</td>
					<td>{$vo.apply_get_number}</td>
					<td>{$vo.apply_done_number}</td>
					<td>{$vo.apply_get_date}</td>
					<td>{$vo.apply_done_date}</td>
					<td>{$vo.apply_group}</td>
					<td>{$vo.apply_user}</td>
					<td><a target="_blank" href="{$apply_image}"><img src="{$apply_image}" style="width:20px; height: 20px;"></a></td>
					<td style="color:<?php echo ($vo['isblack']== 1)? 'green' : 'red'?>"><?php echo ($vo['isblack']== 1)? '正常' : '拉黑'?></td>
					<td>{$vo.apply_remark}</td>
					<td>{$vo.create_time}</td>
					<td>{$vo.update_time}</td>
					
					<td>
						<a href='{:url("applynumbers/edit",array("id"=>$vo["id"]))}'>{:lang('EDIT')}</a>
						<a href="{:url('applynumbers/delete',array('id'=>$vo['id']))}" class="js-ajax-delete">{:lang('DELETE')}</a>
					</td>
				</tr>
				</foreach>
			</tbody>
		</table>
		<div class="pagination">{$page}</div>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
</body>
</html>
